package com.kgc.ljp.server.entity;

import java.io.Serializable;

/**
 * 玩家类,继承自用户信息类
 */
public class User extends UserAndAdmin implements Serializable {
    //昵称
    private String nikeName;
    //手机号
    private String phone;
    //身份证
    private String idCard;
    //等级
    private int level;
    //当前装备嘤雄
    private HeroClass hero;
    //无尽最高攻克到哪个Boss

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public HeroClass getHero() {
        return hero;
    }

    public void setHero(HeroClass hero) {
        this.hero = hero;
    }

    public int getDefense() {
        return defense;
    }

    public void setDefense(int defense) {
        this.defense = defense;
    }

    public int getPower() {
        return power;
    }

    public void setPower(int power) {
        this.power = power;
    }

    public int getBlood() {
        return blood;
    }

    public void setBlood(int blood) {
        this.blood = blood;
    }

    public int getBoom() {
        return boom;
    }

    public void setBoom(int boom) {
        this.boom = boom;
    }

    public String getNikeName() {

        return nikeName;
    }

    public void setNikeName(String nikeName) {
        this.nikeName = nikeName;
    }

    public KunClass getKun() {

        return kun;
    }

    public void setKun(KunClass kun) {
        this.kun = kun;
    }

    private KunClass kun;
    public User(String name, String pwd, int kBi,String nikeName, String phone, String idCard, int level, HeroClass hero, KunClass kun) {
        super(name, pwd);
        this.nikeName = nikeName;
        this.phone = phone;
        this.idCard = idCard;
        this.level = level;
        this.hero = hero;
        this.kun = kun;
        this.kBi = kBi;
        defense = level*3+hero.getDefense();
        power = level*2+hero.getPower();
        blood = level*10+hero.getBlood();
        boom = level+hero.getBoom();
    }

    public int getEmprical() {
        return emprical;
    }

    public void setEmprical(int emprical) {
        this.emprical = emprical;
    }

    private int emprical;
    //防御
    private int defense;
    //攻击
    private int power ;
    //血量
    private int blood ;
    //暴击
    private int boom ;

    public int getkBi() {
        return kBi;
    }

    public void setkBi(int kBi) {
        this.kBi = kBi;
    }

    public User(int defense, int power, int blood, int boom) {
        this.defense = defense;
        this.power = power;
        this.blood = blood;
        this.boom = boom;
    }

    //k币
    private int kBi;
    /**
     * 无参构造
     */
    public User() {
    }

    /**
     * 显示账号信息
     */
    public void printUser(){
        System.out.println(this.getName()+"\t"+nikeName+"\t"+phone+"\t"+idCard+"\t\t"+hero.getName());
    }

    /**
     * 显示游戏玩家信息
     */
    public void printPlayer(){
        String name = null;
        if (kun==null){
            name = "暂无记录";
        }else{
            name = kun.getName();
        }        System.out.println(this.power+"\t\t"+this.defense+"\t\t"+this.blood+"\t\t"+this.boom+"\t\t"+this.getLevel()+"\t\t"+name);
    }
}
